import '../download/file_utils.dart';
import 'dart:convert' as Convert;

import 'WorldCityInfo.dart';
void main()async{
//  String korea = await readAsJson('韩语');
  String chinese = await readAsJson('繁体');
//  String jan = await readAsJson('日语');
//  String traditional = await readAsJson('繁体');
//  String english = await readAsJson('繁体');
//  print(str);
//  WorldCityInfo koreaInfo = WorldCityInfo.fromJson(Convert.json.decode(korea));
  WorldCityInfo chineseInfo = WorldCityInfo.fromJson(Convert.json.decode(chinese));
  print("MMMMMMMMMMMMMMMM"+chineseInfo.toString());
//  WorldCityInfo janInfo = WorldCityInfo.fromJson(Convert.json.decode(jan));
//  WorldCityInfo traditionalInfo = WorldCityInfo.fromJson(Convert.json.decode(traditional));
//  WorldCityInfo englishInfo = WorldCityInfo.fromJson(Convert.json.decode(english));
//
//  if(
//    koreaInfo.location.countryRegion.length == chineseInfo.location.countryRegion.length &&
//    koreaInfo.location.countryRegion.length == janInfo.location.countryRegion.length &&
//    koreaInfo.location.countryRegion.length == traditionalInfo.location.countryRegion.length &&
//    koreaInfo.location.countryRegion.length == englishInfo.location.countryRegion.length
//  ){
////    print('国家数量可以进行下一步');
//  }
//
//  List.generate(koreaInfo.location.countryRegion.length, (index){
//    if(
//    koreaInfo.location.countryRegion[index].states.length == chineseInfo.location.countryRegion[index].states.length &&
//        koreaInfo.location.countryRegion[index].states.length == janInfo.location.countryRegion[index].states.length &&
//        koreaInfo.location.countryRegion[index].states.length == traditionalInfo.location.countryRegion[index].states.length &&
//        koreaInfo.location.countryRegion[index].states.length == englishInfo.location.countryRegion[index].states.length
//    ){
//      print('省份数量可以进行下一步');
//    }
//
//
//  });





//  WorldCityInfo result = WorldCityInfo.empty();
//  List<CountryRegion> countries = [];
//  Location location = Location.fromParams(countryRegion: countries);



}

Future<String> readAsJson(String fileName)async{
  String str = await FileUtils.readJsonFile('test/world_city_info/$fileName.json');
  return str;
}


